import Vue from "vue"
import App from "./App.vue"
import router from "./router"
import axios from "axios"

// h5适配
import "amfe-flexible/index.js"
//引入重置样式表
import "@/assets/css/reset.css"
import store from "./store"
import Vant from "vant"
import "vant/lib/index.css"
// 引入less
// import less from "less"
// Vue.use(less)

import { Lazyload } from "vant"

Vue.use(Lazyload)
Vue.use(Vant)
Vue.prototype.axios = axios

Vue.mixin({
  methods: {
    // 全局混入 日期处理时间戳转换
    $momentFormat(row, column, cellValue) {
      const val = cellValue || row
      const m = moment(val, "x")
      return m.isValid() ? moment(val).format("YYYY-MM-DD HH:mm:ss") : null
    },
    $momentFormat2(row, column, cellValue) {
      const val = cellValue || row
      const m = moment(val, "x")
      return m.isValid() ? moment(val).format("YYYY-MM-DD HH:mm") : null
    },
    $momentFormat2Date(row, column, cellValue) {
      const val = cellValue || row
      const m = moment(val, "x")
      return m.isValid() ? moment(val).format("YYYY-MM-DD") : null
    },
  },
})
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app")
